
#ifndef	MEMORY_BLOCK_HEAPS_H
#define	MEMORY_BLOCK_HEAPS_H


#include "slist_entry_heap.h"


namespace	memory
{

	class	block_heaps
	{
	public:

		block_heaps();
		~block_heaps();

		bool			create( size_t parallelism );
		void			destroy();

		SLIST_ENTRY*	alloc( size_t heap_idx, size_t size );
		SLIST_ENTRY*	try_alloc( size_t heap_idx, size_t size );
		bool			free( size_t heap_idx, SLIST_ENTRY* entry );

		size_t			count()	const;

	private:

		slist_entry_heap*	at( size_t heap_idx )	const;

	private:

		slist_entry_heap*	heaps_;
		size_t				count_;

	};

}


#endif
